﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Tron.Animations
{
    class BlockMoveAnimation : BlockAnimation
    {
        Vector2 start, end;

        public BlockMoveAnimation(BlockAnimator animator, double duration, Vector2 start, Vector2 end)
            : base(animator, duration)
        {
            this.start = start;
            this.end = end;
        }

        public override void Initialize(GameTime gameTime)
        {
            base.Initialize(gameTime);
            Animator.Position = start;
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            Vector2 currentPosition = Vector2.Lerp(start, end, Progress);
            Animator.Position = currentPosition;
        }
    }
}
